package com.wx.task.future.v1;

import cn.hutool.core.thread.ThreadUtil;
import lombok.extern.slf4j.Slf4j;


import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

@Slf4j
public class t1Task implements Callable<Boolean> {

    FutureTask<String> task2 ;

    public t1Task(FutureTask<String> task2) {
        this.task2 = task2;
    }

    @Override
    public Boolean call() throws Exception {
        log.info("{} 开始洗茶壶",Thread.currentThread().getName());
        ThreadUtil.sleep(1000);
        log.info("{} 烧开水",Thread.currentThread().getName());
        ThreadUtil.sleep(15000);
        // 获取茶叶
        String chaye = task2.get();
        log.info("{} 泡茶 茶叶是：{}",Thread.currentThread().getName(),chaye);

        return true;
    }
}
